package org.jeecg.common.es.entity;

import lombok.Data;

import java.util.List;

/**
 * @author wangzun1.vendor@sensetime.com
 * @Description:
 * @date 2022/8/15
 */
@Data
public class EsSearchContext<SearchReq> {
    private SearchReq searchReq;

    private List<Long> ids;

    private Class<? extends EsEntity> entityType;

    public static class Builder<SearchReq> {
        public EsSearchContext<SearchReq> buildContext(SearchReq req, Class<? extends EsEntity> entityType) {
            EsSearchContext<SearchReq> ctx = new EsSearchContext<>();
            ctx.setSearchReq(req);
            ctx.setEntityType(entityType);
            return ctx;
        }
    }
}
